﻿// ===============================================================================
// DispatchHandler.cs
// EOS Web Framework
// ===============================================================================
// Copyright (c) EOS Development Group. All rights reserved.
// ===============================================================================

namespace EOS.Framework.Contracts.Web.Routing
{
    using System.Security.Permissions;
    using System.Web;

    /// <summary>
    /// Dummy handler for routing. Base class needed, so that multiple handler can be used with one registration in the web config.
    /// </summary>
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class DispatchHandler : IHttpHandler
    {
        /// <summary>
        /// Gets a value indicating whether another request can use the <see cref="T:System.Web.IHttpHandler"/> instance.
        /// </summary>
        /// <value></value>
        /// <returns>true if the <see cref="T:System.Web.IHttpHandler"/> instance is reusable; otherwise, false.</returns>
        public bool IsReusable 
        { 
            get { return false; } 
        }

        /// <summary>
        /// Enables processing of HTTP Web requests by a custom HttpHandler 
        /// that implements the <see cref="T:System.Web.IHttpHandler"/> interface.
        /// </summary>
        /// <param name="context">An <see cref="T:System.Web.HttpContext"/> object that provides 
        /// references to the intrinsic server objects (for example, Request, Response, Session, and Server) 
        /// used to service HTTP requests.</param>
        public virtual void ProcessRequest(HttpContext context)
        {
            throw new HttpException(0x194, "");
        }
    }
}
